﻿package com.bizmlib.framework.abstract.commands
{
	import com.bizmlib.framework.abstract.mvc.*;
	
	
	public class AbstractCommand extends Object
	{
		private var __model:AbstractModel;
		private var __view:AbstractView;
		private var __controller:AbstractController;
		
		
		public function AbstractCommand()
		{
		}
		
		
		public function get model():AbstractModel
		{
			return __model;
		}
		public function get view():AbstractView
		{
			return __view;
		}
		public function get controller():AbstractController
		{
			return __controller;
		}
		
		
		public function setMVC(model:AbstractModel, view:AbstractView, controller:AbstractController):void
		{
			__model = model;
			__view = view;
			__controller = controller;
		}
		public function launch():void
		{
			if(!(model && view && controller))
			{
				return;
			}
			
			onLaunchInvoked();
		}
		public function clear():void
		{
			__model = null;
			__view = null;
			__controller = null;
		}
		
		
		protected function onLaunchInvoked():void
		{
		}
		
		
		public function toString():String
		{
			return "[AbstractCommand	]";
		}
	}
}